import {
  TextStyle,
} from './gameObjects';

export const fontStyleObjToStr = (obj: TextStyle): string => {
  const {
    fontStyle = '',
    fontVariant = '',
    fontWeight = '',
    fontSize = null,
    lineHeight = '',
    fontFamily = 'sans-serif'
  } = obj || {};

  let _fontSize = fontSize === null ? 'medium' : `${fontSize}px`

  const res = `${fontStyle} ${fontVariant} ${fontWeight} ${_fontSize}${lineHeight ? '/' + lineHeight : ''} ${fontFamily}`
  return res;
};
